package com.wyz.note.basics.chain;

/**
 * @Description: 客户端测试类
 * @author: wei yz
 * @Date: 2024/8/4 11:28
 */
public class Client {

    public static void main(String[] args) {
        LeaveRequestHandler manager = new Manager();
        LeaveRequestHandler director = new Director();
        LeaveRequestHandler ceo = new CEO();

        // 设置职责链 - 经理 -> 主管 -> CEO
        manager.setSuccessor(director);
        director.setSuccessor(ceo);

        manager.handleRequest(2); // 经理 批准
        manager.handleRequest(5); // 主管 批准
        manager.handleRequest(10); // CEO 批准
    }
}